package tencent;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author habitplus
 * @since 2021-08-22 20:55
 */
public class T20210822N3 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        int n, w;
        T20210822N3 test = new T20210822N3();
        for (int i = 0; i < t; i++) {
            n = in.nextInt();
            w = in.nextInt();
            int[] a = new int[n];

            for (int j = 0; j < n; j++) {
                a[j] = in.nextInt();
            }
            System.out.println(test.fun(a, w));
        }
    }

    public int fun(int[] a, int w) {
        if (a == null || a.length == 0) {
            return 0;
        }

        int ans = 0;

        Arrays.sort(a);

        int n = a.length;
        boolean[] v = new boolean[n];
        int j = -1;
        v[0] = true;
        int t;
        while (n > 1) {
            j = find(v, j);
            if (j == -1) break;
            ans++;
            n--;
            for (int i = a.length - 1; i > j; i--) {
                t = a[j] + a[i];
                if (!v[i] && t <= w && t % 2 == 0) {
                    n--;
                    break;
                }
            }
        }
        return ans + n;
    }

    private int find(boolean[] b, int j) {
        for (int i = j + 1; i < b.length; i++) {
            if (!b[i]) {
                return i;
            }
        }
        return -1;
    }
}
